stack: Compute clip directly
authorTimm Bäder <mail@baedert.org>
Sun, 25 Jun 2017 17:00:30 +0000 (19:00 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:14 +0000 (21:27 -0400)
gtk/gtkstack.c

index 7114b5419933a3c61479da48e1e9dc45d82e219d..6855e67e803f57e35ef46132410240813838901d 100644 (file)
@@ -2029,6 +2029,7 @@ gtk_stack_size_allocate (GtkWidget     *widget,
   GtkStack *stack = GTK_STACK (widget);
   GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
   GtkAllocation clip = *allocation;
+  GdkRectangle child_clip;
   GtkAllocation child_allocation;
 
   child_allocation.x = get_bin_window_x (stack);
@@ -2048,6 +2049,9 @@ gtk_stack_size_allocate (GtkWidget     *widget,
       child_allocation.height = MAX (min, allocation->height);
 
       gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);
+      gtk_widget_get_clip (priv->last_visible_child->widget, &child_clip);
+      gdk_rectangle_union (&clip, &child_clip, &clip);
+
 
       if (!gdk_rectangle_equal (&priv->last_visible_surface_allocation,
                                 &child_allocation))
@@ -2093,10 +2097,10 @@ gtk_stack_size_allocate (GtkWidget     *widget,
         }
 
       gtk_widget_size_allocate (priv->visible_child->widget, &child_allocation);
+      gtk_widget_get_clip (priv->visible_child->widget, &child_clip);
+      gdk_rectangle_union (&clip, &child_clip, &clip);
     }
 
-  gtk_container_get_children_clip (GTK_CONTAINER (widget), &clip);
-
   gtk_widget_set_clip (widget, &clip);
 }